/*
 * Copyright 2003,2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.jakubiak.jpa.translator.discriminator;


/**
 * This discriminator is usefull when we have a entity class
 * which represents table with record which should have the 
 * same translation. For example:
 * table Room( id, hotelName, roomName )
 * 1, "Sobieski", SGL Standard
 * 2, "Mariot", SGL Standard
 * As you can see, both hotels has room with the same name.
 * Default JpaDiscriminator give you to translation request
 * for the same string "SGL Standard". Using NoDiscriminator
 * give you only translation request for "SGL Standard"
 * 
 * XXX, I'm thinking if Discriminator can return
 * big string which represents complete primary key,
 * for example:
 * eu.jakubiak.entity.Hotel#name#1 
 * I think, I should be done in next release.
 * 
 * @author Antek
 */
public class NoDiscriminator implements Discriminator {

    /**
     * Default value
     * Probably You cannot use NULL, while not all database 
     * provider accepts NULL value in primary key.
     * PostgreSQL doesn't accept it.
     */
    private static final Long VALUE = new Long(0);
    
    
    public Long discriminate(Object object) {
        return VALUE;
    }
}
